<template>
	<view class="u-rela page-wrap">
		<view :class="['item',{right:index%2!=0}]" v-for="(item,index) in list" key="index">
			<view class="content">
				<view class="time">{{item.time}}</view>
				<image class="honor"
					:src="item.thumbnail == '' ? 'https://wxcode.sowreap.cn/nongmuWeChatImage/static/images/dongtu/img-v-16.png' : item.thumbnail"
					mode="widthFix"></image>
				<view class="name">{{item.title}}</view>
				<view class="desc">{{item.introduce}}</view>
			</view>
			<image class="dot-line"
				src="https://wxcode.sowreap.cn/nongmuWeChatImage/static/images/vallige/icon-dot-line.png"
				mode="widthFix"></image>
		</view>
	</view>
</template>

<script>
	export default {
		components: {},
		data() {
			return {
				list: [

				],

				id: ''
			}
		},
		onLoad(options) {
			// console.log(options);
			this.id = options.id

			// 乡村荣誉列表
			this.get_villages_honor(this.id)
		},
		methods: {
			// 乡村荣誉列表
			get_villages_honor(village_id) {
				uni.showLoading({
					title: '加载中...'
				});
				this.$http({
					url: this.api.villages_honor,
					method: 'GET',
					data: {
						village_id
					}
				}).then(res => {
					if (res.code == 1) {
						uni.hideLoading();
						if (res.data == '') return uni.showToast({
							icon: 'error',
							title: '暂无荣誉',
							duration: 2000
						})
						this.list = res.data
					}
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	.page-wrap {
		margin-top: 180rpx;
	}

	.item {
		display: flex;
		margin-top: -120rpx;

		.content {
			width: 320rpx;
			padding: 0 40rpx;
			margin-right: 40rpx;

			image {
				width: 240rpx;
				height: 160rpx;
				margin-top: 10rpx;
			}

			.time {
				width: 184rpx;
				height: 40rpx;
				background: #07C160;
				border-radius: 20rpx 20rpx 20rpx 0px;
				display: flex;
				align-items: center;
				justify-content: center;
				font-size: 26rpx;
				font-family: Roboto;
				font-weight: 400;
				color: #FFFFFF;
			}

			.name {
				font-size: 26rpx;
				line-height: 1;
			}

			.desc {
				font-size: 22rpx;
				color: #999;
				margin-top: 10rpx;
			}
		}

		.dot-line {
			width: 36rpx;
			height: 176rpx;
		}
	}

	.item.right {
		margin-left: 360rpx;

		.content {
			order: 1;
			padding-left: 70rpx;
		}
	}
</style>
<style>
	page {
		padding: 0;
		background: #fff;
	}
</style>